package com.smfx.yxt.common.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 调课状态
 * @author hqm
 *
 */
public enum TeacherChangeCourseApply {
	
	AGREE("000","审核通过"),
	PENDING("001","待处理"),
	EXCHANGE_TEACHER_OK("002","调代看课老师同意"),
	EXCHANGE_TEACHER_NO("003","调代看课老师拒绝"),
	AUDIT_TEACHER_ING("004","待教务处审核中"),
	AUDIT_TEACHER_NO("005","教务处审核驳回"),
	AUDIT_TEACHER_CANCEL("006","教务处撤消"),
	APPLY_TEACHER_CANCEL("007","失效");

	private final String code;
	
	private final String value;
	
	private TeacherChangeCourseApply(String code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String getValue(String key) {
		for(TeacherChangeCourseApply type : TeacherChangeCourseApply.values()) {
			if(type.getCode().equals(key)) {
				return type.getValue();
			}
		}
		return "";
	}
	
	public static String getNextValue(String key) {
		if(StringUtils.isBlank(key)) return "";
		if(key.equals(TeacherChangeCourseApply.PENDING.getCode())) {
			return "等待调代看课老师同意";
		}
		return getValue(key);
	}
	
	public String getCode() {
		return code;
	}

	public String getValue() {
		return value;
	}
	
}
